package jmine.tec.services.export.export;

import java.util.Collections;
import java.util.List;

import jmine.tec.services.api.ActionsEnum;
import jmine.tec.services.api.export.AbstractEntityExporter;
import jmine.tec.services.api.export.DefaultExportAction;
import jmine.tec.services.api.export.ExportAction;
import jmine.tec.services.api.export.ReferenceMap;
import jmine.tec.services.io.ServiceBean;

public class MockEntityAssociationExporter extends AbstractEntityExporter<MockEntityAssociation> {

    public MockEntityAssociationExporter() {
        super(DefaultExportAction.INCLUIR);
    }

    public List<ServiceBean> export(ReferenceMap referenceMap, MockEntityAssociation entity) {
        ServiceBean bean = new ServiceBean();
        bean.setName("AssociatedMockEntity");
        bean.setAction(ActionsEnum.INCLUIR);
        bean.getParameters().put("Mock", referenceMap.getReference(entity.getBaseEntity()));
        bean.getParameters().put("Value", entity.getAssociatedEntity().getValue());
        return Collections.singletonList(bean);
    }

    @Override
    public ExportAction getAction() {
        return DefaultExportAction.INCLUIR;
    }
}